package help;

import grid.Grid;
import jv.vecmath.PdVector;

public class GridHelper {

	private GridHelper() {
	}
	
	public static PdVector[] gridToPdVectorArray(Grid grid){
		final PdVector[] vertices = new PdVector[grid.size()];
		for (int i = 0; i < vertices.length; i++) {
			vertices[i] = new PdVector(grid.get(i).toArray());
		}
		return vertices;
	}
	
	public static PdVector[] gridToScaledPdVectorArray(Grid grid, double scaleX, double scaleY){
		final PdVector[] vertices = new PdVector[grid.size()];
		for (int i = 0; i < vertices.length; i++) {
			double[] point = grid.get(i).toArray();
			vertices[i] = (new PdVector(point[0]*scaleX, point[1]*scaleY));
		}
		return vertices;
	}

}
